package org.redhat.auth.security.user;

import java.util.Collection;
import java.util.Date;
import java.util.Map;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

/**
 * 扩展User类，加入一些其它属性
 * 
 * @author lingen.liu
 * 
 */
public class UserDetailInfo extends User {

	/* 用户真实姓名 */
	private String realName;

	/* 用户Email */
	private String email;

	/* 用户注册日期 */
	private Date registryDate;

	/* 上次修改密码日期 */
	private Date passwordLastUpdateDate;

	/* 用户描述 */
	private String description;

	/*
	 * 检测是否是测试用户
	 */
	private boolean isTestUser;

	public UserDetailInfo(String username, String password, boolean enabled,
			boolean accountNonExpired, boolean credentialsNonExpired,
			boolean accountNonLocked, Collection<GrantedAuthority> authorities) {
		super(username, password, enabled, accountNonExpired,
				credentialsNonExpired, accountNonLocked, authorities);
	}

	private static final long serialVersionUID = 9188494832615361052L;

	public String getRealName() {
		return realName;
	}

	public String getEmail() {
		return email;
	}

	public Date getRegistryDate() {
		return registryDate;
	}

	public Date getPasswordLastUpdateDate() {
		return passwordLastUpdateDate;
	}

	public String getDescription() {
		return description;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public void setRegistryDate(Date registryDate) {
		this.registryDate = registryDate;
	}

	public void setPasswordLastUpdateDate(Date passwordLastUpdateDate) {
		this.passwordLastUpdateDate = passwordLastUpdateDate;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public boolean isTestUser() {
		return isTestUser;
	}

	public void setTestUser(boolean isTestUser) {
		this.isTestUser = isTestUser;
	}
	
}
